<%--
  Created by IntelliJ IDEA.
  User: MI
  Date: 2021/10/11
  Time: 16:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>

</head>
<body>
<table border="1" cellspacing="0" width="300">
    <tr>
        <th>编号</th>
        <th>name</th>
        <th>age</th>
    </tr>
    <c:forEach items="${sessionScope.users}" var="user" varStatus="c">
        <tr>
            <td>${c.count}</td>
            <td>${user.name}</td>
            <td>${user.age}</td>
        </tr>
    </c:forEach>
</table>
<c:if test="${pagenum>1}">
    <a href="/user/list.do?pagenum=1">首页</a>

    <a href="/user/list.do?pagenum=${pagenum-1}&size=3">上一页</a>
</c:if>
<a href="/user/list.do?pagenum=1&size=3">1</a>
<a href="/user/list.do?pagenum=2&size=3">2</a>
<a href="/user/list.do?pagenum=3&size=3">3</a>
<a href="/user/list.do?pagenum=4&size=3">4</a>
<a href="/user/list.do?pagenum=5&size=3">5</a>
<c:if test="${pagenum<to}">

    <a href="/user/list.do?pagenum=${pagenum+1}&size=3">下一页</a>

    <a href="/user/list.do?pagenum=${sessionScope.to}&size=3">尾页</a>
</c:if>
共${sessionScope.to }页，${ sessionScope.total}条记
</body>
</html>
